package com.kuangstudy.controller.archives;

import java.util.HashMap;
import java.util.Map;

/**
 * Description:
 * Author: yykk Administrator
 * Version: 1.0
 * Create Date Time: 2021/11/16 22:37.
 * Update Date Time:
 *
 * @see
 */
public class TestStreamGroup {

    public static void main(String[] args) {
//        List<Blog> list = new ArrayList<>();
//
//        list.add(new Blog(1,"张三1", LocalDateTime.of(2021,11,11,1,0)));
//        list.add(new Blog(3,"张三3", LocalDateTime.of(2021,11,12,0,0)));
//        list.add(new Blog(2,"张三2", LocalDateTime.of(2021,11,12,0,2)));
//        list.add(new Blog(4,"张三4", LocalDateTime.of(2020,12,12,3,0)));
//        list.add(new Blog(5,"张三5", LocalDateTime.of(2019,01,12,0,0)));
//
//        TreeMap<Integer, List<Blog>> collect1 = list.stream()
//                .collect(Collectors.groupingBy(blog -> blog.getCreateTime().getYear(), TreeMap::new, Collectors.toList()));

        stateArea();
    }

    public static void stateArea(){
        HashMap<Integer,String> hashMap = new HashMap<>();
        for (int i = 0; i < 1000000; i++) {
            hashMap.put(i,"yyykk");
        }

        for (Map.Entry<Integer, String> integerStringEntry : hashMap.entrySet()) {
            System.out.println(integerStringEntry.getKey()+"==="+integerStringEntry.getValue());
        }
    }
}
